package com.lopo.controller;

import com.lopo.annotation.RateLimiter;
import com.lopo.emun.LimitType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.Max;
import java.util.Date;

@RestController
public class HelloController {
    @GetMapping("/hello")
    @RateLimiter(time = 50, count = 2, limitType = LimitType.IP)
    public String hello() {

        return "hello>>>" + new Date();
    }
}